function showResultFigure6( fig, cellData, measNum, sampleName, frames, cntrs, pixSize, channelPos, areaRatioMax, colors )
set(0,'CurrentFigure',fig);clf;
divX = 7.4; divY = 4.1;
widthX = 1/divX; widthY = 1/divY;

mskAreaRatio = cellData.data.areaRatio <= areaRatioMax;
cellPosX = cellData.data.xPosAcc - channelPos(1)*pixSize;
endCoord = diff(channelPos)*pixSize;

[posX, posY] = getSubPos(1,3,divX,divY); %set(gca, 'Position', [posX posY widthX widthY]);
subplot('Position',[posX posY widthX widthY]);
% subplot(3,5,1);
imagesc([frames{1}; repmat(max(max(frames{1}(:)),max(frames{2}(:))),10,size(frames{1},2)); frames{2}]);colormap gray;axis image;axis off;
hold on;
hp1 = plot([cntrs{1}(:,1);cntrs{1}(1,1)]+1,[cntrs{1}(:,2);cntrs{1}(1,2)]+1,'-','Color',colors(1,:));hp1.Color(4) = 0.5;
hp1 = plot([cntrs{2}(:,1);cntrs{2}(1,1)]+1,[cntrs{2}(:,2);cntrs{2}(1,2)]+1+size(frames{1},1)+10,'-','Color',colors(1,:));hp1.Color(4) = 0.5;
hold off;
title('1. frame & @ inlet');

[posX, posY] = getSubPos(2,3,divX,divY);
subplot('Position',[posX posY widthX widthY]);
% subplot(3,5,2);
imagesc([frames{3}; repmat(max(max(frames{3}(:)),max(frames{4}(:))),10,size(frames{3},2)); frames{4}]);colormap gray;axis image;axis off;
hold on;
hp1 = plot([cntrs{3}(:,1);cntrs{3}(1,1)]+1,[cntrs{3}(:,2);cntrs{3}(1,2)]+1,'-','Color',colors(1,:));hp1.Color(4) = 0.5;
hp1 = plot([cntrs{4}(:,1);cntrs{4}(1,1)]+1,[cntrs{4}(:,2);cntrs{4}(1,2)]+1+size(frames{3},1)+10,'-','Color',colors(1,:));hp1.Color(4) = 0.5;
hold off;
title('50% & 95% in channel');

[posX, posY] = getSubPos(3,3,divX,divY);
subplot('Position',[posX posY widthX widthY]);
% subplot(3,5,3);
imagesc([frames{5}; repmat(max(max(frames{5}(:)),max(frames{6}(:))),10,size(frames{5},2)); frames{6}]);colormap gray;axis image;axis off;
hold on;
hp1 = plot([cntrs{5}(:,1);cntrs{5}(1,1)]+1,[cntrs{5}(:,2);cntrs{5}(1,2)]+1,'-','Color',colors(1,:));hp1.Color(4) = 0.5;
hp1 = plot([cntrs{6}(:,1);cntrs{6}(1,1)]+1,[cntrs{6}(:,2);cntrs{6}(1,2)]+1+size(frames{5},1)+10,'-','Color',colors(1,:));hp1.Color(4) = 0.5;
hold off;
title('@ outlet & last frame');

[posX, posY] = getSubPos(4,3,divX,divY);
subplot('Position',[posX posY widthX widthY]);
% subplot(3,5,4);
plot(cellPosX,cellData.data.areaRatio,'.-','Color',colors(2,:)); hold on;
plot(cellPosX(mskAreaRatio),cellData.data.areaRatio(mskAreaRatio),'o','Color',colors(3,:)); hold off;
yLim = get(gca,'YLim');line([0 0],yLim,'Color',colors(1,:));line(endCoord*[1 1],yLim,'Color',colors(1,:));set(gca,'YLim',yLim);
xlabel('Axial cell position (µm)');
ylabel('Area ratio');

[posX, posY] = getSubPos(5,3,divX,divY);
subplot('Position',[posX posY widthX widthY]);
% subplot(3,5,5);
plot(cellPosX(mskAreaRatio),cellData.data.volume(mskAreaRatio));yLim = get(gca,'YLim');
plot(cellPosX,cellData.data.volume,'.-');
line([0 0],yLim,'Color',colors(1,:));line(endCoord*[1 1],yLim,'Color',colors(1,:));
set(gca,'YLim',yLim);
xlabel('Axial cell position (µm)');
ylabel('Volume (µm^3)');

[posX, posY] = getSubPos(1,2,divX,divY);
subplot('Position',[posX posY widthX widthY]);
% subplot(3,5,6);
plot(cellData.data.time(mskAreaRatio), cellPosX(mskAreaRatio));xLim = get(gca,'XLim');
plot(cellData.data.time,cellPosX,'.-','Color',colors(2,:));
line(xLim,[0 0],'Color',colors(1,:));line(xLim,endCoord*[1 1],'Color',colors(1,:));
set(gca,'XLim',xLim);
xlabel('Time (ms)');
ylabel('Axial cell position (µm)');

[posX, posY] = getSubPos(2,2,divX,divY);
subplot('Position',[posX posY widthX widthY]);
% subplot(3,5,7);
plot(cellPosX(mskAreaRatio),cellData.data.yPos(mskAreaRatio));yLim = get(gca,'YLim');
plot(cellPosX,cellData.data.yPos,'.-','Color',colors(2,:));
line([0 0],yLim,'Color',colors(1,:));line(endCoord*[1 1],yLim,'Color',colors(1,:));
set(gca,'YLim',yLim);
xlabel('Axial cell position (µm)');
ylabel('Lateral cell position (µm)');

[posX, posY] = getSubPos(3,2,divX,divY);
subplot('Position',[posX posY widthX widthY]);
% subplot(3,5,8);
plot(cellPosX(mskAreaRatio),gradient(cellData.data.xPosAcc(mskAreaRatio),cellData.data.time(mskAreaRatio))*0.1, '.-');yLim = get(gca,'YLim');
plot(cellPosX,gradient(cellData.data.xPosAcc,cellData.data.time)*0.1,'.-','Color',colors(2,:));
line([0 0],yLim,'Color',colors(1,:));line(endCoord*[1 1],yLim,'Color',colors(1,:));
set(gca,'YLim',yLim);
xlabel('Axial cell position (µm)');
ylabel('axial velocity in cm/s');

[posX, posY] = getSubPos(4,2,divX,divY);
subplot('Position',[posX posY widthX widthY]);
% subplot(3,5,9);
plot(cellPosX(mskAreaRatio),cellData.data.lambdaRatio(mskAreaRatio));yLim = get(gca,'YLim');
plot(cellPosX,cellData.data.lambdaRatio,'.-');
line([0 0],yLim,'Color',colors(1,:));line(endCoord*[1 1],yLim,'Color',colors(1,:));set(gca,'YLim',yLim);
xlabel('Axial cell position (µm)');
ylabel('Lamba ratio');

[posX, posY] = getSubPos(5,2,divX,divY);
subplot('Position',[posX posY widthX widthY]);
% subplot(3,5,10);
plot(cellPosX(mskAreaRatio),cellData.data.surfaceArea(mskAreaRatio));yLim = get(gca,'YLim');
plot(cellPosX,cellData.data.surfaceArea,'.-');
line([0 0],yLim,'Color',colors(1,:));line(endCoord*[1 1],yLim,'Color',colors(1,:));
set(gca,'YLim',yLim);
xlabel('Axial cell position (µm)');
ylabel('Surface area (µm^2)');

[posX, posY] = getSubPos(1,1,divX,divY);
subplot('Position',[posX posY widthX widthY]);
% subplot(3,5,11);
plot(cellPosX(mskAreaRatio),1-cellData.data.circularity(mskAreaRatio));yLim = get(gca,'YLim');
plot(cellPosX,1-cellData.data.circularity,'.-','Color',colors(2,:));
line([0 0],yLim,'Color',colors(1,:));line(endCoord*[1 1],yLim,'Color',colors(1,:));
set(gca,'YLim',yLim);
xlabel('Axial cell position (µm)');
ylabel('Deformation');

[posX, posY] = getSubPos(2,1,divX,divY);
subplot('Position',[posX posY widthX widthY]);
% subplot(3,5,12);
plot(cellPosX(mskAreaRatio),cellData.data.ax1(mskAreaRatio),cellPosX(mskAreaRatio),cellData.data.ax2(mskAreaRatio));yLim = get(gca,'YLim');
plot(cellPosX,cellData.data.ax1,'.-','Color',colors(2,:));hold on;
plot(cellPosX,cellData.data.ax2,'.-','Color',colors(3,:));hold off;
line([0 0],yLim,'Color',colors(1,:));line(endCoord*[1 1],yLim,'Color',colors(1,:));
set(gca,'YLim',yLim);
xlabel('Axial cell position (µm)');
ylabel(['{\color[rgb]{' sprintf('%f,%f,%f',colors(2,:)) '}Ax1}, {\color[rgb]{' sprintf('%f,%f,%f',colors(3,:)) '}Ax2} length (µm)']);

[posX, posY] = getSubPos(3,1,divX,divY);
subplot('Position',[posX posY widthX widthY]);
% subplot(3,5,13);
plot(cellPosX(mskAreaRatio),cellData.data.areaRaw(mskAreaRatio),cellPosX(mskAreaRatio),cellData.data.area(mskAreaRatio));yLim = get(gca,'YLim');
plot(cellPosX,cellData.data.areaRaw,'.-','Color',colors(2,:));hold on;
plot(cellPosX,cellData.data.area,'.-','Color',colors(3,:));hold off;
ylabel(['{\color[rgb]{' sprintf('%f,%f,%f',colors(2,:)) '}Raw} {\color[rgb]{' sprintf('%f,%f,%f',colors(3,:)) '}area} (µm^2)']);
line([0 0],yLim,'Color',colors(1,:));line(endCoord*[1 1],yLim,'Color',colors(1,:));set(gca,'YLim',yLim);
xlabel('Axial cell position (µm)');

[posX, posY] = getSubPos(5,1,divX,divY);
subplot('Position',[posX posY widthX widthY]);
% subplot(3,5,15);
plot(cellPosX(mskAreaRatio),cellData.data.surfaceArea(mskAreaRatio)./cellData.data.volume(mskAreaRatio));yLim = get(gca,'YLim');
plot(cellPosX,cellData.data.surfaceArea./cellData.data.volume,'.-');
line([0 0],yLim,'Color',colors(1,:));line(endCoord*[1 1],yLim,'Color',colors(1,:));
set(gca,'YLim',yLim);
xlabel('Axial cell position (µm)');
ylabel('SurfArea/volume (1/µm)');

axes('Position',[0, 0.95, 1, 0.05]);axis off;
text(0.5, 0, sprintf('Sample: %s, M%i, cell %i: start = %i, end = %i, length = %i', sampleName, measNum, cellData.number, cellData.videoPointers(1), cellData.videoPointers(end), cellData.videoPointers(end)-cellData.videoPointers(1)+1),...
    'FontSize', 14', 'FontWeight', 'Bold', ...
    'HorizontalAlignment', 'Center', 'VerticalAlignment', 'Bottom' ) ;
end

function [posX, posY] = getSubPos(nX, nY, divX, divY)
posX = (nX*0.40 + (nX-1)*1)/divX;
posY = (nY*0.27 + (nY-1)*1)/divY;
end